# Maintainer:
# Contributor: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Simon Perry <aur [at] sanxion [dot] net>
# Contributor: Jonas Nyrén <jonas.nyren*mindkiller.com>

pkgname=libsidplayfp
pkgver=2.5.0
pkgrel=2
pkgdesc='Library to play Commodore 64 music, derived from libsidplay2'
url='https://github.com/libsidplayfp/libsidplayfp'
arch=(loong64 x86_64)
license=(GPL)
depends=(libgcrypt)
makedepends=(vice xa)
optdepends=('vice: better SID support')
source=("https://downloads.sourceforge.net/project/sidplay-residfp/${pkgname}/${pkgver%.*}/${pkgname}-${pkgver}.tar.gz")
sha256sums=('3a22751b72b1f5b36ba7d39af7f63947de201d02117a0e156153464cb89f0bd1')

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  DESTDIR="$pkgdir" make -C $pkgname-$pkgver install
}
